package cn.lf.android.lawfirm;

import android.app.ProgressDialog;
import android.content.Context;
import android.widget.ProgressBar;

/**
 * Created by qianfan on 2017/8/16.
 */

public class BaseController {

    protected ProgressDialog bar;
    /**
     * 显示默认ProgressBar
     */
    public void showProgressDia(Context context) {
        if (bar == null) {
            try {
                bar = ProgressDialog.show(context, null, null);
                bar.setProgressStyle(R.style.ProgressDialog);
                bar.setContentView(R.layout.taste_loading);
            } catch (Exception e) {
            }

        }
    }

    /**
     * 取消ProgressBar
     */
    public void dismissProgressDia() {
        if (bar != null && bar.isShowing()) {
            try {
                bar.dismiss();

            } catch (Exception e) {
            }
            bar = null;
        }
    }
}
